package com.movie.demo.controller;

import com.movie.demo.Utlis.result.CommonResult;
import com.movie.demo.pojo.Picture;
import com.movie.demo.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class PictureController {
    @Autowired
    private PictureService pictureService;

    @PostMapping("/SelectPicture")
    public CommonResult<List> SelectPicture(@RequestBody Picture picture){
        List<Picture> pictures=pictureService.SelectPicture(picture.getMid());
        return CommonResult.success(pictures);
    }
}
